Skip to content

Conversation

SebastiaanWouters
Copy link
Contributor

Add @pinia/colada plugin to openapi-ts with example implementation.

  • Add PiniaColadaPlugin type definitions and configuration
  • Register plugin in config system and plugin type map
  • Include example Vue application demonstrating Pinia Colada integration
  • Update pnpm-lock.yaml with new dependencies

Add @pinia/colada plugin to openapi-ts with example implementation.

- Add PiniaColadaPlugin type definitions and configuration
- Register plugin in config system and plugin type map
- Include example Vue application demonstrating Pinia Colada integration
- Update pnpm-lock.yaml with new dependencies
- Fix linting issues in generated code
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

changeset-bot bot commented Aug 21, 2025

🦋 Changeset detected

Latest commit: 97c57f6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hey-api/openapi-ts Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Aug 21, 2025

@SebastiaanWouters is attempting to deploy a commit to the Hey API Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. feature 🚀 New feature or request labels Aug 21, 2025
Copy link

codecov bot commented Aug 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 23.81%. Comparing base (aa0bfaa) to head (97c57f6).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2505      +/-   ##
==========================================
- Coverage   23.83%   23.81%   -0.03%     
==========================================
  Files         357      359       +2     
  Lines       35416    35464      +48     
  Branches     1499     1500       +1     
==========================================
+ Hits         8442     8444       +2     
- Misses      26962    27008      +46     
  Partials       12       12              
Flag Coverage Δ
unittests 23.81% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

pkg-pr-new bot commented Aug 21, 2025

Open in StackBlitz

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/nuxt@2505
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/openapi-ts@2505
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/vite-plugin@2505

commit: 97c57f6

@mrlubos
Copy link
Member

mrlubos commented Aug 21, 2025

Hey @SebastiaanWouters, mind describing how similar/different this is from #1680? I'd be looking to merge both

SebastiaanWouters and others added 3 commits August 22, 2025 11:43
…plugin

- Add autoDetectHttpMethod option (default: true) to automatically detect query vs mutation based on HTTP method
- GET requests → query, POST/PUT/PATCH/DELETE → mutation
- Add operationTypes option to override auto-detection for specific operations
- Add groupByTag option to organize generated files by OpenAPI tags
- Add exportFromIndex option to create index file when groupByTag is enabled
- Maintain backward compatibility with existing configurations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Add extensive testing coverage including:

**Unit Tests**:
- HTTP method auto-detection logic (GET → query, POST/PUT/DELETE → mutation)
- Operation type override functionality
- groupByTag file organization logic
- Configuration validation and defaults
- Complex integration scenarios

**Snapshot Tests**:
- Default plugin configuration
- Auto-detection disabled scenarios
- Operation type overrides (getPetById: 'both', addPet: 'query')
- groupByTag with and without index files
- Custom naming patterns and case settings
- Disabled options combinations
- Complex configurations combining all features
- Meta function configurations

**Functional Tests**:
- Generated code structure validation
- Query/mutation options format verification
- Runtime behavior testing with mock requests
- AbortSignal integration testing
- Tag-based file organization verification
- Index file generation validation
- Meta property inclusion verification

**Integration Tests**:
- Compatibility with different HTTP clients (fetch, axios)
- Multi-plugin configurations
- Custom SDK transformers compatibility
- Different response styles (data vs response)
- Class-based SDK integration
- Various case settings between plugins
- TypeScript/JavaScript enum compatibility
- Plugin dependency validation
- OpenAPI version compatibility (2.0.x, 3.0.x, 3.1.x)
- Error handling for edge cases

**Meta Function Tests**:
- Query meta function configuration
- Mutation meta function configuration
- Combined meta functions with groupByTag
- Custom meta properties with complex configurations

This comprehensive test suite ensures robust functionality across all plugin features and configurations, following the established testing patterns from other plugins in the codebase.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Update example configuration to demonstrate new features:
- Enable autoDetectHttpMethod with clear documentation
- Show groupByTag configuration options
- Demonstrate operationTypes overrides with examples
- Add exportFromIndex option explanation
- Include commented examples for common use cases

This provides users with a clear reference for utilizing the new HTTP method auto-detection and groupByTag features.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Add eslint-disable comments for unused _heyApiClient imports
- Add eslint-disable comments for unused options parameters in mutation functions
- Maintain original SDK configuration as requested
- All lint checks now pass successfully
Copy link
Member

@mrlubos mrlubos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SebastiaanWouters just making sure you saw my earlier comment!

@mrlubos
Copy link
Member

mrlubos commented Aug 25, 2025

I'll take it from here! You should still get the credit once it's merged 🤝

@mrlubos mrlubos force-pushed the feat/pinia-colada-plugin branch 2 times, most recently from 507e868 to d2089b0 Compare August 26, 2025 06:17
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 26, 2025
@mrlubos mrlubos force-pushed the feat/pinia-colada-plugin branch from d2089b0 to 97c57f6 Compare August 26, 2025 06:25
@mrlubos mrlubos merged commit 533e44b into hey-api:main Aug 26, 2025
11 of 13 checks passed
@SebastiaanWouters
Copy link
Contributor Author

thanks for completing and accepting the pr @mrlubos. Feel free to let me know if you need further help with this / other plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🚀 New feature or request lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants